//
//  MSdongjieListCell.m
//  觅尚
//
//  Created by No.8 on 2019/5/7.
//  Copyright © 2019 No.8. All rights reserved.
//

#import "MSdongjieListCell.h"

@implementation MSdongjieListCell

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    MSdongjieListCell * cell = [tableView dequeueReusableCellWithIdentifier:[MSdongjieListCell ID]];
    cell = [[MSdongjieListCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[MSdongjieListCell ID]];
    cell.backgroundColor = backgroundcolor;
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setMember];
        
    }
    return self;
}

- (void)setMember{
    /** 图片*/
    self.photoIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 20 * px, 150 * px, 150 * px)];
    self.photoIMG.image = [UIImage imageNamed:@"酒水数据"];
//    self.photoIMG.layer.cornerRadius = 50 * px;
    self.photoIMG.layer.masksToBounds = YES;
    [self addSubview:self.photoIMG];
    
    
    /** 名称*/
    self.commodityLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.photoIMG.frame) + 20 * px, self.photoIMG.y, ScreenWidth * 0.5, 60 * px)];
    self.commodityLabel.textColor = [UIColor whiteColor];
    self.commodityLabel.text = @"李四";
    self.commodityLabel.textAlignment = NSTextAlignmentLeft;
    self.commodityLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [self addSubview:self.commodityLabel];
    
    
    /** 上班签到*/
    self.SigninLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.commodityLabel.x, CGRectGetMaxY(self.commodityLabel.frame) + 30 * px, self.commodityLabel.width, self.commodityLabel.height)];
    self.SigninLabel.textColor = self.commodityLabel.textColor;
    self.SigninLabel.text = @"10:00";
    self.SigninLabel.textAlignment = NSTextAlignmentLeft;
    self.SigninLabel.font = [UIFont systemFontOfSize:SYRealValue(26 / 2)];
    [self addSubview:self.SigninLabel];
    
    
    /** 分割线*/
    self.lineView = [[UIView alloc] initWithFrame:CGRectMake(self.commodityLabel.x, 190 * px - 1, ScreenWidth - 210 * px, 1)];
    self.lineView.backgroundColor = BackViewColor;
    [self addSubview:self.lineView];
    
}
- (void)setDongjieListModel:(MSDongjieListModel *)DongjieListModel{
    _DongjieListModel = DongjieListModel;
    [self.photoIMG sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",DongjieListModel.avatarUrl]] placeholderImage:[UIImage imageNamed:@"我的占位头像"]];
//
    if ([DongjieListModel.gender isEqualToString:@"0"]) {
        self.commodityLabel.text = [NSString stringWithFormat:@"%@(女)",DongjieListModel.userName];
    }else{
        self.commodityLabel.text = [NSString stringWithFormat:@"%@(男)",DongjieListModel.userName];
    }
    self.SigninLabel.text = [NSString stringWithFormat:@"部门:%@",DongjieListModel.pst_alias];

    
}


+(NSString *)ID{
    return @"cell";
}


@end
